<?php
namespace Home\Controller;
use Home\Model\WeixinModel;
use Think\Controller;
class PublicController extends Controller
{
    public function islogin(){
        $isopid=cookie("openid");
        if($isopid){
            return true;
        }else{
            $this->author();
        }
    }
    public function author(){
        $items["Title"] ="授权";
        $items["Description"]="授权获取用户信息";
        $items["PicUrl"] ="Publuic/img/default.jpg";
        $items["Url"] = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=".C("appid").
        "&redirect_uri=".C("host").U("Index/oauth2")."&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect";
        $WeChat = new WeixinModel();
        $WeChat->getweixin()->text(array($items ))->reply();
    }
}

?>